package com.willowandcreek.addongenie.google;

import java.util.logging.Logger;

import com.google.gdata.client.docs.DocsService;
import com.google.gdata.util.AuthenticationException;

public class Services {
	private static final Logger LOGGER = Logger.getLogger(Services.class
			.getName());
	
	private static Services INSTANCE = null;
	public static final String APP_VER = "1.0";
	public static final String APP_ID = "willowandcreek-addongenie-" + APP_VER;

	private static DocsService docsService = null;
	
	public static void Initialize(String userName, String password) throws Exception {
		if (INSTANCE != null)
			return;
		
		INSTANCE = new Services(userName, password);
		Repository.instance();
	}
	
	private Services(String userName, String password) throws AuthenticationException {
		docsService = new DocsService(APP_ID);
		docsService.setUserCredentials(userName, password);
	}
	
	public static DocsService getDocsService() {
		return docsService;
	}
	
}
